<!DOCTYPE html>
<html>
<head><meta name="generator" content="Hexo 3.9.0">
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  
  <title>C++面向对象程序设计期末考试复习笔记 | Mark&#39;s blog</title>
  
  

  

  <meta name="HandheldFriendly" content="True">
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <!-- meta -->
  

  <!-- link -->
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.css">
  
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/node-waves@0.7.6/dist/waves.min.css">
  
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.10.1/css/all.min.css">
  

  
  <link rel="shortcut icon" type="image/x-icon" href="https://cdn.jsdelivr.net/gh/xaoxuu/assets@master/favicon/favicon.ico">
  

  
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/xaoxuu/cdn-material-x@19.5/css/style.css">
  

  <script>
    function setLoadingBarProgress(num) {
      document.getElementById('loading-bar').style.width=num+"%";
    }
  </script>

  
  
</head>

<body>
  
  
  <div class="cover-wrapper">
    <cover class='cover post half'>
      
        
  <h1 class='title'>Mark's blog</h1>


  <div class="m_search">
    <form name="searchform" class="form u-search-form">
      <input type="text" class="input u-search-input" placeholder="" />
      <i class="icon fas fa-search fa-fw"></i>
    </form>
  </div>

<div class='menu navgation'>
  <ul class='h-list'>
    
      
        <li>
          <a class="nav home" href="/"
            
            
            id="home">
            <i class='fas fa-home fa-fw'></i>&nbsp;首页
          </a>
        </li>
      
        <li>
          <a class="nav home" href="/projects/"
            
            
            id="projects">
            <i class='fas fa-code-branch fa-fw'></i>&nbsp;项目
          </a>
        </li>
      
        <li>
          <a class="nav home" href="/archives/"
            
              rel="nofollow"
            
            
            id="archives">
            <i class='fas fa-archive fa-fw'></i>&nbsp;归档
          </a>
        </li>
      
        <li>
          <a class="nav home" href="/about/"
            
              rel="nofollow"
            
            
            id="about">
            <i class='fas fa-info-circle fa-fw'></i>&nbsp;关于
          </a>
        </li>
      
    
  </ul>
</div>

      
    </cover>
    <header class="l_header pure">
  <div id="loading-bar-wrapper">
    <div id="loading-bar" class="pure"></div>
  </div>

	<div class='wrapper'>
		<div class="nav-main container container--flex">
      <a class="logo flat-box" href='/' >
        
          Mark's blog
        
      </a>
			<div class='menu navgation'>
				<ul class='h-list'>
          
  					
  						<li>
								<a class="nav flat-box" href="/"
                  
                  
                  id="home">
									<i class='fas fa-home fa-fw'></i>&nbsp;首页
								</a>
							</li>
      			
  						<li>
								<a class="nav flat-box" href="/archives/"
                  
                    rel="nofollow"
                  
                  
                  id="archives">
									<i class='fas fa-archive fa-fw'></i>&nbsp;归档
								</a>
							</li>
      			
  						<li>
								<a class="nav flat-box" href="/books/"
                  
                  
                  id="books">
									<i class='fas fa-book-open fa-fw'></i>&nbsp;读书
								</a>
							</li>
      			
  						<li>
								<a class="nav flat-box" href="/about/"
                  
                    rel="nofollow"
                  
                  
                  id="about">
									<i class='fas fa-info-circle fa-fw'></i>&nbsp;关于
								</a>
							</li>
      			
      		
				</ul>
			</div>

			
				<div class="m_search">
					<form name="searchform" class="form u-search-form">
						<input type="text" class="input u-search-input" placeholder="搜索" />
						<i class="icon fas fa-search fa-fw"></i>
					</form>
				</div>
			
			<ul class='switcher h-list'>
				
					<li class='s-search'><a class="fas fa-search fa-fw" href='javascript:void(0)'></a></li>
				
				<li class='s-menu'><a class="fas fa-bars fa-fw" href='javascript:void(0)'></a></li>
			</ul>
		</div>

		<div class='nav-sub container container--flex'>
			<a class="logo flat-box"></a>
			<ul class='switcher h-list'>
				<li class='s-comment'><a class="flat-btn fas fa-comments fa-fw" href='javascript:void(0)'></a></li>
        
          <li class='s-toc'><a class="flat-btn fas fa-list fa-fw" href='javascript:void(0)'></a></li>
        
			</ul>
		</div>
	</div>
</header>
	<aside class="menu-phone">
    <header>
		<nav class="menu navgation">
      <ul>
        
          
            <li>
							<a class="nav flat-box" href="/"
                
                
                id="home">
								<i class='fas fa-clock fa-fw'></i>&nbsp;近期文章
							</a>
            </li>
          
            <li>
							<a class="nav flat-box" href="/archives/"
                
                  rel="nofollow"
                
                
                id="archives">
								<i class='fas fa-archive fa-fw'></i>&nbsp;文章归档
							</a>
            </li>
          
            <li>
							<a class="nav flat-box" href="/projects/"
                
                
                id="projects">
								<i class='fas fa-code-branch fa-fw'></i>&nbsp;开源项目
							</a>
            </li>
          
            <li>
							<a class="nav flat-box" href="/books/"
                
                
                id="books">
								<i class='fas fa-book-open fa-fw'></i>&nbsp;读书专栏
							</a>
            </li>
          
            <li>
							<a class="nav flat-box" href="/friends/"
                
                  rel="nofollow"
                
                
                id="friends">
								<i class='fas fa-link fa-fw'></i>&nbsp;我的友链
							</a>
            </li>
          
            <li>
							<a class="nav flat-box" href="https://xaoxuu.com/wiki/material-x/"
                
                  rel="nofollow"
                
                
                id="https:xaoxuu.comwikimaterial-x">
								<i class='fas fa-book fa-fw'></i>&nbsp;主题文档
							</a>
            </li>
          
            <li>
							<a class="nav flat-box" href="/about/"
                
                  rel="nofollow"
                
                
                id="about">
								<i class='fas fa-info-circle fa-fw'></i>&nbsp;关于小站
							</a>
            </li>
          
       
      </ul>
		</nav>
    </header>
	</aside>
<script>setLoadingBarProgress(40);</script>

  </div>


  <div class="l_body">
    <div class='body-wrapper'>
      <div class='l_main'>
  

  
    <article id="post" class="post white-box article-type-post" itemscope itemprop="blogPost">
      


  <section class='meta'>
    
    
    <div class="meta" id="header-meta">
      
        
  
    <h1 class="title">
      <a href="/2019/01/09/CPP_Final/">
        C++面向对象程序设计期末考试复习笔记
      </a>
    </h1>
  


      
      <div class='new-meta-box'>
        
          
        
          
            
  <div class='new-meta-item author'>
    <a href="https://mark-thinkpad.gitee.io" rel="nofollow">
      
        <img src="https://img.vim-cn.com/e5/755adedff8463a344e0870b440b718d4f4fa93.jpg">
      
      <p>Mark</p>
    </a>
  </div>


          
        
          
            <div class="new-meta-item date">
  <a class='notlink'>
    <i class="fas fa-calendar-alt" aria-hidden="true"></i>
    <p>2019-01-09</p>
  </a>
</div>

          
        
          
            
  
  <div class='new-meta-item category'>
    <a href='/categories/Programs/' rel="nofollow">
      <i class="fas fa-folder-open" aria-hidden="true"></i>
      <p>Programs</p>
    </a>
  </div>


          
        
          
            
  
    <div class="new-meta-item browse busuanzi">
      <a class='notlink'>
        <i class="fas fa-eye" aria-hidden="true"></i>
        <p>
          <span id="busuanzi_value_page_pv">
            <i class="fas fa-spinner fa-spin fa-fw" aria-hidden="true"></i>
          </span>
        </p>
      </a>
    </div>
  


          
        
          
            

          
        
      </div>
      
        <hr>
      
    </div>
  </section>


      <section class="article typo">
        <div class="article-entry" itemprop="articleBody">
          <h1 id="Content"><a href="#Content" class="headerlink" title="Content"></a>Content</h1><!-- TOC -->

<ul>
<li><a href="#content">Content</a></li>
<li><a href="#c复习笔记">C++复习笔记</a><ul>
<li><a href="#选择题">选择题</a></li>
<li><a href="#填空题">填空题</a></li>
<li><a href="#编程题">编程题</a></li>
<li><a href="#简答题">简答题</a></li>
</ul>
</li>
</ul>
<!-- /TOC -->

<hr>
<a id="more"></a>

<hr>
<h1 id="C-复习笔记"><a href="#C-复习笔记" class="headerlink" title="C++复习笔记"></a>C++复习笔记</h1><h2 id="选择题"><a href="#选择题" class="headerlink" title="选择题"></a>选择题</h2><ol>
<li>函数重载中, 函数名相同, <strong>但是形参的个数或者形参的类型应该不相同</strong></li>
<li>在继承中, 析构函数可以被继承, 派生类也是基类的延续, 派生类的成员除了它自己的成员外, 还包含了它的基类的成员</li>
<li>拷贝构造函数的声明形式: <code>类名(类名 &amp; 对象名);</code> eg: <code>A(A&amp;);</code></li>
<li>一个类的<strong>友元类</strong>的成员函数都是这个类的<strong>友元函数</strong></li>
<li>友元的正确使用可以提高程序的运行效率</li>
<li>静态数据成员是类的所有对象所共有的. eg: <code>static int a;</code></li>
<li>(异常处理)<code>catch</code>只检查只捕获异常信息的类型, 不检查它们的值</li>
<li>实现两个相同类型数加法的函数模板的声明是 <code>T add(T x,T y)</code></li>
<li>析构函数不需要指定参数</li>
<li>不会调用拷贝构造函数的是: <code>将类的一个对象赋予该类的另一个对象时</code></li>
</ol>
<hr>
<h2 id="填空题"><a href="#填空题" class="headerlink" title="填空题"></a>填空题</h2><ol>
<li>指向常量的指针, 在定义指针的要在前面加上<code>const</code>, eg: <code>const char * p = &quot;abcd&quot;;</code></li>
<li>在类的成员函数中, 若要访问类本身的对象, 可以使用一个特殊指针 <code>this</code></li>
<li>带有 <strong>纯虚函数</strong> 的类称为抽象类, 抽象类的特征是不能声明一个抽象类的对象, 但可以声明一个抽象类的指针或引用</li>
<li>基于MFC对话框编程时, 若要将变量的值更新到界面, 使用 <code>UpdateData(FALSE);</code></li>
<li>MFC中使用GDI绘图中, 有一个重要的类叫设备上下文, 其类名为 <code>CDC</code></li>
<li>MFC的文档/视图结构中，有两个重要的类分别叫 <code>文档类(CDocument)</code> 和 <code>视图类(CView)</code></li>
<li>所有类的根类类名叫 <code>CObject</code></li>
</ol>
<hr>
<h2 id="编程题"><a href="#编程题" class="headerlink" title="编程题"></a>编程题</h2><ol>
<li>用友元函数重载运算符</li>
</ol>
<figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#<span class="meta-keyword">include</span><span class="meta-string">&lt;iostream&gt;</span></span></span><br><span class="line"><span class="keyword">using</span> <span class="keyword">namespace</span> <span class="built_in">std</span>;</span><br><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">complex</span></span></span><br><span class="line"><span class="class">&#123;</span></span><br><span class="line">	<span class="keyword">float</span> real,imag;                                    <span class="comment">// 复数的实部和虚部</span></span><br><span class="line"><span class="keyword">public</span>:</span><br><span class="line">	<span class="keyword">complex</span>(<span class="keyword">float</span> r=<span class="number">0</span>,<span class="keyword">float</span> i=<span class="number">0</span>)</span><br><span class="line">	&#123;real=r;imag=i;&#125;</span><br><span class="line">	<span class="function"><span class="keyword">void</span> <span class="title">print</span><span class="params">()</span></span>;</span><br><span class="line">	<span class="keyword">friend</span> <span class="keyword">complex</span> <span class="keyword">operator</span> +(<span class="keyword">complex</span> a,<span class="keyword">complex</span> b);</span><br><span class="line">	<span class="keyword">friend</span> <span class="keyword">complex</span> <span class="keyword">operator</span> -(<span class="keyword">complex</span> a,<span class="keyword">complex</span> b);</span><br><span class="line">	<span class="keyword">friend</span> <span class="keyword">complex</span> <span class="keyword">operator</span> *(<span class="keyword">complex</span> a,<span class="keyword">complex</span> b);</span><br><span class="line">	<span class="keyword">friend</span> <span class="keyword">complex</span> <span class="keyword">operator</span> /(<span class="keyword">complex</span> a,<span class="keyword">complex</span> b);</span><br><span class="line">&#125;;</span><br><span class="line"></span><br><span class="line"><span class="keyword">void</span> <span class="keyword">complex</span>::print()</span><br><span class="line">&#123;</span><br><span class="line">	<span class="built_in">cout</span>&lt;&lt;real;</span><br><span class="line">	<span class="keyword">if</span>(imag&gt;<span class="number">0</span>) <span class="built_in">cout</span>&lt;&lt;<span class="string">"+"</span>;                            <span class="comment">// image小于0，则自带-</span></span><br><span class="line">	<span class="keyword">if</span>(imag!=<span class="number">0</span>) <span class="built_in">cout</span>&lt;&lt;imag&lt;&lt;<span class="string">"i\n"</span>;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="keyword">complex</span> <span class="keyword">operator</span>+(<span class="keyword">complex</span> a,<span class="keyword">complex</span> b)</span><br><span class="line">&#123;</span><br><span class="line">	<span class="keyword">complex</span> temp;</span><br><span class="line">	temp.real=a.real+b.real;</span><br><span class="line">	temp.imag=a.imag+b.imag;</span><br><span class="line">	<span class="keyword">return</span> temp;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="keyword">complex</span> <span class="keyword">operator</span>-(<span class="keyword">complex</span> a,<span class="keyword">complex</span> b)</span><br><span class="line">&#123;</span><br><span class="line">	<span class="keyword">complex</span> temp;</span><br><span class="line">	temp.real=a.real-b.real;</span><br><span class="line">	temp.imag=a.imag-b.imag;</span><br><span class="line">	<span class="keyword">return</span> temp;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="keyword">complex</span> <span class="keyword">operator</span>*(<span class="keyword">complex</span> a,<span class="keyword">complex</span> b)</span><br><span class="line">&#123;</span><br><span class="line">    <span class="keyword">complex</span> temp;</span><br><span class="line">    temp.real=a.real*b.real-a.imag*b.imag;</span><br><span class="line">    temp.imag=a.real*b.imag+a.imag*b.real;</span><br><span class="line">    <span class="keyword">return</span> temp;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="keyword">complex</span> <span class="keyword">operator</span>/(<span class="keyword">complex</span> a,<span class="keyword">complex</span> b)</span><br><span class="line">&#123;</span><br><span class="line">	<span class="keyword">complex</span> temp;</span><br><span class="line">	<span class="keyword">float</span> tt;</span><br><span class="line">	tt=<span class="number">1</span>/(b.real*b.real+b.imag*b.imag);</span><br><span class="line">	temp.real=(a.real*b.real+a.imag*b.imag)*tt;</span><br><span class="line">	temp.imag=(b.real*a.imag-a.real*b.imag)*tt;</span><br><span class="line">	<span class="keyword">return</span> temp;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">void</span> <span class="title">main</span><span class="params">()</span></span></span><br><span class="line"><span class="function"></span>&#123;</span><br><span class="line">	complex c1(2.3,4.6),c2(3.6,2.8),c3;</span><br><span class="line">	c1.print();</span><br><span class="line">	c2.print();</span><br><span class="line">	c3=c1+c2;</span><br><span class="line">	c3.print();</span><br><span class="line">	c3=c1-c2;</span><br><span class="line">	c3.print();</span><br><span class="line">	c3=c1*c2;</span><br><span class="line">	c3.print();</span><br><span class="line">	c3=c1/c2;</span><br><span class="line">	c3.print();</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<ol start="3">
<li>继承的例子</li>
</ol>
<figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#<span class="meta-keyword">include</span><span class="meta-string">&lt;iostream&gt;</span></span></span><br><span class="line"><span class="keyword">using</span> <span class="keyword">namespace</span> <span class="built_in">std</span>;</span><br><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">Animal</span></span></span><br><span class="line"><span class="class">&#123;</span></span><br><span class="line"><span class="keyword">public</span>:</span><br><span class="line">	<span class="keyword">double</span> weight;</span><br><span class="line"><span class="keyword">public</span>:</span><br><span class="line">	Animal(<span class="keyword">double</span> wei)	&#123; weight = wei;	&#125;</span><br><span class="line">	<span class="function"><span class="keyword">virtual</span> <span class="keyword">void</span> <span class="title">Speak</span><span class="params">()</span></span>&#123;	&#125;=<span class="number">0</span>;</span><br><span class="line">&#125;;</span><br><span class="line"></span><br><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">Dog</span> :</span><span class="keyword">public</span> Animal</span><br><span class="line">&#123;</span><br><span class="line"><span class="keyword">public</span>:</span><br><span class="line">	Dog(<span class="keyword">double</span> wei) : Animal(wei)	&#123;	&#125;</span><br><span class="line">	<span class="function"><span class="keyword">void</span> <span class="title">Speak</span><span class="params">()</span></span></span><br><span class="line"><span class="function">	</span>&#123;	<span class="built_in">cout</span> &lt;&lt; <span class="string">"我是狗，重量为："</span> &lt;&lt; weight &lt;&lt; <span class="built_in">endl</span>;	&#125;</span><br><span class="line">&#125;;</span><br><span class="line"></span><br><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">Cat</span> :</span><span class="keyword">public</span> Animal</span><br><span class="line">&#123;</span><br><span class="line"><span class="keyword">public</span>:</span><br><span class="line">	Cat(<span class="keyword">double</span> wei) : Animal(wei)	&#123;	&#125;</span><br><span class="line">	<span class="function"><span class="keyword">void</span> <span class="title">Speak</span><span class="params">()</span></span></span><br><span class="line"><span class="function">	</span>&#123;	<span class="built_in">cout</span> &lt;&lt; <span class="string">"我是猫，重量为："</span> &lt;&lt; weight &lt;&lt; <span class="built_in">endl</span>;	&#125;</span><br><span class="line">&#125;;</span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">void</span> <span class="title">main</span><span class="params">()</span></span></span><br><span class="line"><span class="function"></span>&#123;</span><br><span class="line">	<span class="function">Dog <span class="title">dog</span><span class="params">(<span class="number">10</span>)</span></span>;  <span class="function">Cat <span class="title">cat</span><span class="params">(<span class="number">20</span>)</span></span>;  Animal *p;	<span class="comment">// 体现类的多态性, 父类的指针引用子类对象</span></span><br><span class="line">	p=&amp;dog; p-&gt;Speak();</span><br><span class="line">	p=&amp;cat; p-&gt;Speak();</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<hr>
<h2 id="简答题"><a href="#简答题" class="headerlink" title="简答题"></a>简答题</h2><ol>
<li>简述Windows API窗口编程的主要步骤</li>
</ol>
<p>答：主要有4个步骤：</p>
<ul>
<li>（1）注册窗口类；     </li>
<li>（2）程序初始化（或，分成2步：创建窗口，显示窗口）</li>
<li>（3）建立消息主循环   </li>
<li>（4）使用窗口函数处理消息<br>评分：第2步2分，其余步骤各1分。回答的意思清楚就可以，不要求非常严谨。</li>
</ul>
<ol start="2">
<li>简述MFC编程中建立和使用对话框窗口的主要过程</li>
</ol>
<p>答：主要有5个步骤：</p>
<ul>
<li>（1）设计对话框的外观（资源）            </li>
<li>（2）创建对话框窗口类</li>
<li>（3）在使用处，定义对话框类的对象        </li>
<li>（4）用对象来调用DoModal函数以显示对话框</li>
<li>（5）使用对话框对象中的成员变量带回的数据<br>评分：每步各1分。回答的意思清楚就可以，不要求非常严谨。</li>
</ul>
<ol start="3">
<li>说明在窗口中采用自定义画笔和画刷绘制矩形、圆和输出文本的方法，或写出关键代码案例。</li>
</ol>
<p>答：主要有三个步骤</p>
<ul>
<li>（1）绘制矩形：创建新画笔和新画刷，并选入窗口的CDC对象，再使用Rectangle函数画矩形</li>
<li>（2）绘制圆：创建新画笔和新画刷，并选入窗口的CDC对象，再使用Ellipse函数画圆</li>
<li>（3）输出文本：设置窗口CDC的前景色和背景色，再使用TextOut函数输出文本<br>评分：矩形、圆 — 各2分，文本 – 1分。回答的意思清楚就可以，不要求非常严谨。</li>
</ul>
<ol start="4">
<li>简述MFC中文档-视图结构中，文档类和视类各自的职责以及相互间的怎样互动方法</li>
</ol>
<p>答：</p>
<ul>
<li>（1）文档负责数据的存储、管理、保存                 — （1分）</li>
<li>（2）视图负责数据的显示、用户交互                   — （2分）</li>
<li>（3）文档通过UpdateAllViews来使得视图重绘          — （1分）</li>
<li>（4）视图通过GetDocumnet函数来得到相应的文档指针   — （1分）</li>
</ul>
<ol start="5">
<li>什么是通用对话框？试举一例来说明其使用。</li>
</ol>
<p>答：</p>
<ul>
<li>（1）对于可视化编程中常用的颜色、文件、文本替换、字体、打印等选择的情况经常发生，于是MFC就预先定义了有关对话框的类，用户不需要再设计对话框界面，就可以简单地使用统一风格的对话框来满足应用的要求。<br>这种预先定义的、相对频繁的功能对话框就是通用对话框。     — （2分）</li>
<li>（2）譬如CColorDialog类就是颜色选择对话框，它提供了颜色选择的常用功能。<br>用户定义ColorDialog类的对象，通过设置其数据成员m_cc来初始化对话框，通过调用DoModal来启动显示对话框。一旦用户确认后可以通过调用GetColor成员函数或直接访问m_cc来得到用户最终选择的颜色。   — （3分）</li>
</ul>
<ol start="6">
<li>设备环境接口是什么？它与CDC类有什么关系？</li>
</ol>
<p>答：</p>
<ul>
<li>（1）图形设备接口GDI管理windows的图形输出，它提供用户使用的绘图函数，以及一些图形对象，并管理绘图状态。    — （2分）</li>
<li>（2）CDC类是GDI的封装类，它定义了环境对象，提供了各种图形设备的绘图方法，并包含了使用设备环境的GDI函数。   — （3分）</li>
</ul>

        </div>
        
          


  <section class='meta' id="footer-meta">
    <hr>
    <div class='new-meta-box'>
      
        
          <div class="new-meta-item date" itemprop="dateUpdated" datetime="2019-08-26T17:15:22+08:00">
  <a class='notlink'>
    <i class="fas fa-clock" aria-hidden="true"></i>
    <p>最后更新于 2019年8月26日</p>
  </a>
</div>

        
      
        
          
  
  <div class="new-meta-item meta-tags"><a class="tag" href="/tags/C/" rel="nofollow"><i class="fas fa-hashtag" aria-hidden="true"></i>&nbsp;<p>C++</p></a></div> <div class="new-meta-item meta-tags"><a class="tag" href="/tags/CPP/" rel="nofollow"><i class="fas fa-hashtag" aria-hidden="true"></i>&nbsp;<p>CPP</p></a></div>


        
      
        
          
  <div class="new-meta-item share -mob-share-list">
  <div class="-mob-share-list share-body">
    
      
        <a class="-mob-share-qq" title="QQ好友" rel="external nofollow noopener noreferrer"
          
          href="http://connect.qq.com/widget/shareqq/index.html?url=https://mark-thinkpad.gitee.io/2019/01/09/CPP_Final/&title=C++面向对象程序设计期末考试复习笔记 | Mark's blog&pics=https://img.vim-cn.com/e5/755adedff8463a344e0870b440b718d4f4fa93.jpg&summary=Content


Content
C++复习笔记
选择题
填空题
编程题
简答题





"
          
          >
          
            <img src="https://cdn.jsdelivr.net/gh/xaoxuu/assets@19.1.9/logo/128/qq.png">
          
        </a>
      
    
      
        <a class="-mob-share-qzone" title="QQ空间" rel="external nofollow noopener noreferrer"
          
          href="https://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=https://mark-thinkpad.gitee.io/2019/01/09/CPP_Final/&title=C++面向对象程序设计期末考试复习笔记 | Mark's blog&pics=https://img.vim-cn.com/e5/755adedff8463a344e0870b440b718d4f4fa93.jpg&summary=Content


Content
C++复习笔记
选择题
填空题
编程题
简答题





"
          
          >
          
            <img src="https://cdn.jsdelivr.net/gh/xaoxuu/assets@19.1.9/logo/128/qzone.png">
          
        </a>
      
    
      
        <a class='qrcode' rel="external nofollow noopener noreferrer" href=''>
        
          <img src="https://cdn.jsdelivr.net/gh/xaoxuu/assets@19.1.9/logo/128/wechat.png">
        
        </a>
      
    
      
        <a class='qrcode' rel="external nofollow noopener noreferrer" href=''>
        
          <img src="https://cdn.jsdelivr.net/gh/xaoxuu/assets@19.1.9/logo/128/qrcode.png">
        
        </a>
      
    
  </div>
</div>



        
      
    </div>
  </section>


        
        
            <div class="prev-next">
                
                    <section class="prev">
                        <span class="art-item-left">
                            <h6><i class="fas fa-chevron-left" aria-hidden="true"></i>&nbsp;上一页</h6>
                            <h4>
                                <a href="/2019/01/20/sp/" rel="prev" title="小鹤双拼学习总结">
                                  
                                      小鹤双拼学习总结
                                  
                                </a>
                            </h4>
                            
                                
                                <h6 class="tags">
                                    <a class="tag" href="/tags/双拼/"><i class="fas fa-hashtag fa-fw" aria-hidden="true"></i>双拼</a>
                                </h6>
                            
                        </span>
                    </section>
                
                
                    <section class="next">
                        <span class="art-item-right" aria-hidden="true">
                            <h6>下一页&nbsp;<i class="fas fa-chevron-right" aria-hidden="true"></i></h6>
                            <h4>
                                <a href="/2018/12/27/beyond1/" rel="prev" title="《自卑与超越》读书笔记 (第一章)">
                                    
                                        《自卑与超越》读书笔记 (第一章)
                                    
                                </a>
                            </h4>
                            
                                
                                <h6 class="tags">
                                    <a class="tag" href="/tags/book/"><i class="fas fa-hashtag fa-fw" aria-hidden="true"></i>book</a> <a class="tag" href="/tags/beyond/"><i class="fas fa-hashtag fa-fw" aria-hidden="true"></i>beyond</a>
                                </h6>
                            
                        </span>
                    </section>
                
            </div>
        
      </section>
    </article>
  

  
    <!-- 显示推荐文章和评论 -->



  <article class="post white-box comments">
    <section class="article typo">
      <h4><i class="fas fa-comments fa-fw" aria-hidden="true"></i>&nbsp;评论</h4>
      
      
      
      
        <section id="comments">
          <div id="valine_container" class="valine_thread">
            <i class="fas fa-spinner fa-spin fa-fw"></i>
          </div>
        </section>
      
    </section>
  </article>


  




<!-- 根据页面mathjax变量决定是否加载MathJax数学公式js -->



  <script>
    window.subData = {
      title: 'C++面向对象程序设计期末考试复习笔记',
      tools: true
    }
  </script>


</div>
<aside class='l_side'>
  
    
    
      
        
          
          
            <section class='widget author'>
  <div class='content pure'>
    
      <div class='avatar'>
        <img class='avatar' src='https://img.vim-cn.com/e5/755adedff8463a344e0870b440b718d4f4fa93.jpg'/>
      </div>
    
    
    
      <div class="social-wrapper">
        
          
            <a href="mailto:zhouganqing2018@gmail.com"
              class="social fas fa-envelope flat-btn"
              target="_blank"
              rel="external nofollow noopener noreferrer">
            </a>
          
        
          
            <a href="https://github.com/Mark-ThinkPad"
              class="social fab fa-github flat-btn"
              target="_blank"
              rel="external nofollow noopener noreferrer">
            </a>
          
        
          
            <a href="https://twitter.com/LumiaExtraordin"
              class="social fab fa-twitter flat-btn"
              target="_blank"
              rel="external nofollow noopener noreferrer">
            </a>
          
        
          
            <a href="https://t.me/LumiaExtraordinary"
              class="social fab fa-telegram flat-btn"
              target="_blank"
              rel="external nofollow noopener noreferrer">
            </a>
          
        
          
            <a href="https://music.163.com/#/user/home?id=35189854"
              class="social fas fa-headphones-alt flat-btn"
              target="_blank"
              rel="external nofollow noopener noreferrer">
            </a>
          
        
      </div>
    
  </div>
</section>

          
        
      
        
          
          
            
  <section class='widget toc-wrapper'>
    
<header class='pure'>
  <div><i class="fas fa-list fa-fw" aria-hidden="true"></i>&nbsp;&nbsp;本文目录</div>
  
    <div class='wrapper'><a class="s-toc rightBtn" rel="external nofollow noopener noreferrer" href="javascript:void(0)"><i class="fas fa-thumbtack fa-fw"></i></a></div>
  
</header>

    <div class='content pure'>
      <ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#Content"><span class="toc-text">Content</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#C-复习笔记"><span class="toc-text">C++复习笔记</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#选择题"><span class="toc-text">选择题</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#填空题"><span class="toc-text">填空题</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#编程题"><span class="toc-text">编程题</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#简答题"><span class="toc-text">简答题</span></a></li></ol></li></ol>
    </div>
  </section>


          
        
      
        
          
          
            <section class='widget grid'>
  
<header class='pure'>
  <div><i class="fas fa-map-signs fa-fw" aria-hidden="true"></i>&nbsp;&nbsp;站内导航</div>
  
</header>

  <div class='content pure'>
    <ul class="grid navgation">
      
        <li><a class="flat-box" title="/" href="/"
          
          
          id="home">
          
            <i class="fas fa-clock fa-fw" aria-hidden="true"></i>
          
          近期文章
        </a></li>
      
        <li><a class="flat-box" title="/archives/" href="/archives/"
          
            rel="nofollow"
          
          
          id="archives">
          
            <i class="fas fa-archive fa-fw" aria-hidden="true"></i>
          
          文章归档
        </a></li>
      
        <li><a class="flat-box" title="/projects/" href="/projects/"
          
          
          id="projects">
          
            <i class="fas fa-code-branch fa-fw" aria-hidden="true"></i>
          
          开源项目
        </a></li>
      
        <li><a class="flat-box" title="/books/" href="/books/"
          
          
          id="books">
          
            <i class="fas fa-book-open fa-fw" aria-hidden="true"></i>
          
          读书专栏
        </a></li>
      
        <li><a class="flat-box" title="/friends/" href="/friends/"
          
            rel="nofollow"
          
          
          id="friends">
          
            <i class="fas fa-link fa-fw" aria-hidden="true"></i>
          
          我的友链
        </a></li>
      
        <li><a class="flat-box" title="/about/" href="/about/"
          
            rel="nofollow"
          
          
          id="about">
          
            <i class="fas fa-info-circle fa-fw" aria-hidden="true"></i>
          
          关于小站
        </a></li>
      
    </ul>
  </div>
</section>

          
        
      
        
          
          
            
  <section class='widget category'>
    
<header class='pure'>
  <div><i class="fas fa-folder-open fa-fw" aria-hidden="true"></i>&nbsp;&nbsp;文章分类</div>
  
    <a class="rightBtn"
    
      rel="nofollow"
    
    
    href="/categories/"
    title="categories/">
    <i class="fas fa-expand-arrows-alt fa-fw"></i></a>
  
</header>

    <div class='content pure'>
      <ul class="entry">
        
          <li><a class="flat-box" title="/categories/Basic/" href="/categories/Basic/"><div class='name'>Basic</div><div class='badge'>(1)</div></a></li>
        
          <li><a class="flat-box" title="/categories/Play-on-Linux/" href="/categories/Play-on-Linux/"><div class='name'>Play_on_Linux</div><div class='badge'>(3)</div></a></li>
        
          <li><a class="flat-box" title="/categories/Programs/" href="/categories/Programs/"><div class='name'>Programs</div><div class='badge'>(10)</div></a></li>
        
          <li><a class="flat-box" title="/categories/Projects/" href="/categories/Projects/"><div class='name'>Projects</div><div class='badge'>(2)</div></a></li>
        
          <li><a class="flat-box" title="/categories/Start-Linux/" href="/categories/Start-Linux/"><div class='name'>Start_Linux</div><div class='badge'>(3)</div></a></li>
        
          <li><a class="flat-box" title="/categories/books/" href="/categories/books/"><div class='name'>books</div><div class='badge'>(6)</div></a></li>
        
          <li><a class="flat-box" title="/categories/movies/" href="/categories/movies/"><div class='name'>movies</div><div class='badge'>(2)</div></a></li>
        
          <li><a class="flat-box" title="/categories/置顶消息/" href="/categories/置顶消息/"><div class='name'>置顶消息</div><div class='badge'>(1)</div></a></li>
        
      </ul>
    </div>
  </section>


          
        
      
        
          
          
            
  <section class='widget tagcloud'>
    
<header class='pure'>
  <div><i class="fas fa-fire fa-fw" aria-hidden="true"></i>&nbsp;&nbsp;热门标签</div>
  
    <a class="rightBtn"
    
      rel="nofollow"
    
    
    href="/tags/"
    title="tags/">
    <i class="fas fa-expand-arrows-alt fa-fw"></i></a>
  
</header>

    <div class='content pure'>
      <a href="/tags/C/" style="font-size: 14px; color: #999">C++</a> <a href="/tags/CPP/" style="font-size: 14px; color: #999">CPP</a> <a href="/tags/Django/" style="font-size: 20.67px; color: #6c6c6c">Django</a> <a href="/tags/Interstellar/" style="font-size: 14px; color: #999">Interstellar</a> <a href="/tags/Linux/" style="font-size: 24px; color: #555">Linux</a> <a href="/tags/MySQL/" style="font-size: 14px; color: #999">MySQL</a> <a href="/tags/PyQt5/" style="font-size: 14px; color: #999">PyQt5</a> <a href="/tags/Python3/" style="font-size: 22.33px; color: #606060">Python3</a> <a href="/tags/QQ空间/" style="font-size: 14px; color: #999">QQ空间</a> <a href="/tags/TCP/" style="font-size: 14px; color: #999">TCP</a> <a href="/tags/The-Wandering-Earth/" style="font-size: 14px; color: #999">The Wandering Earth</a> <a href="/tags/Web/" style="font-size: 19px; color: #777">Web</a> <a href="/tags/beyond/" style="font-size: 15.67px; color: #8e8e8e">beyond</a> <a href="/tags/blog/" style="font-size: 14px; color: #999">blog</a> <a href="/tags/book/" style="font-size: 19px; color: #777">book</a> <a href="/tags/deepin-wine/" style="font-size: 14px; color: #999">deepin-wine</a> <a href="/tags/grub2/" style="font-size: 14px; color: #999">grub2</a> <a href="/tags/qq/" style="font-size: 14px; color: #999">qq</a> <a href="/tags/refind/" style="font-size: 14px; color: #999">refind</a> <a href="/tags/self/" style="font-size: 17.33px; color: #828282">self</a> <a href="/tags/terminal/" style="font-size: 14px; color: #999">terminal</a> <a href="/tags/tim/" style="font-size: 14px; color: #999">tim</a> <a href="/tags/主站点/" style="font-size: 14px; color: #999">主站点</a> <a href="/tags/双拼/" style="font-size: 14px; color: #999">双拼</a> <a href="/tags/影评/" style="font-size: 15.67px; color: #8e8e8e">影评</a> <a href="/tags/星际穿越/" style="font-size: 14px; color: #999">星际穿越</a> <a href="/tags/流浪地球/" style="font-size: 14px; color: #999">流浪地球</a> <a href="/tags/自动点赞/" style="font-size: 14px; color: #999">自动点赞</a>
    </div>
  </section>


          
        
      
        
          
          
            


  <section class='widget music'>
    
<header class='pure'>
  <div><i class="fas fa-compact-disc fa-fw" aria-hidden="true"></i>&nbsp;&nbsp;推荐音乐</div>
  
    <a class="rightBtn"
    
      rel="external nofollow noopener noreferrer"
    
    
      target="_blank"
    
    href="https://music.163.com/#/user/home?id=35189854"
    title="https://music.163.com/#/user/home?id=35189854">
    <i class="far fa-heart fa-fw"></i></a>
  
</header>

    <div class='content pure'>
      
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/aplayer@1.7.0/dist/APlayer.min.css">
  <div class="aplayer"
    data-theme="#1BCDFC"
    
    
    data-mode="circulation"
    data-server="netease"
    data-type="playlist"
    data-id="2945119589"
    data-volume="0.7">
  </div>
  <script src="https://cdn.jsdelivr.net/npm/aplayer@1.7.0/dist/APlayer.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/meting@1.1.0/dist/Meting.min.js"></script>


    </div>
  </section>


          
        
      
    

  
</aside>

<footer id="footer" class="clearfix">
  
  
    <div class="social-wrapper">
      
        
          <a href="mailto:zhouganqing2018@gmail.com"
            class="social fas fa-envelope flat-btn"
            target="_blank"
            rel="external nofollow noopener noreferrer">
          </a>
        
      
        
          <a href="https://github.com/Mark-ThinkPad"
            class="social fab fa-github flat-btn"
            target="_blank"
            rel="external nofollow noopener noreferrer">
          </a>
        
      
        
          <a href="https://twitter.com/LumiaExtraordin"
            class="social fab fa-twitter flat-btn"
            target="_blank"
            rel="external nofollow noopener noreferrer">
          </a>
        
      
        
          <a href="https://t.me/LumiaExtraordinary"
            class="social fab fa-telegram flat-btn"
            target="_blank"
            rel="external nofollow noopener noreferrer">
          </a>
        
      
        
          <a href="https://music.163.com/#/user/home?id=35189854"
            class="social fas fa-headphones-alt flat-btn"
            target="_blank"
            rel="external nofollow noopener noreferrer">
          </a>
        
      
    </div>
  
  <br>
  <div><p>博客内容遵循 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh">署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0) 协议</a></p>
</div>
  <div>
    本站使用
    <a href="https://xaoxuu.com/wiki/material-x/" target="_blank" class="codename">Material X</a>
    作为主题
    
      ，
      总访问量为
      <span id="busuanzi_value_site_pv"><i class="fas fa-spinner fa-spin fa-fw" aria-hidden="true"></i></span>
      次
    
    。
  </div>
</footer>
<script>setLoadingBarProgress(80);</script>


      <script>setLoadingBarProgress(60);</script>
    </div>
    <a class="s-top fas fa-arrow-up fa-fw" href='javascript:void(0)'></a>
  </div>
  <script src="https://cdn.jsdelivr.net/npm/jquery@3.3.1/dist/jquery.min.js"></script>

  <script>
    var GOOGLE_CUSTOM_SEARCH_API_KEY = "";
    var GOOGLE_CUSTOM_SEARCH_ENGINE_ID = "";
    var ALGOLIA_API_KEY = "";
    var ALGOLIA_APP_ID = "";
    var ALGOLIA_INDEX_NAME = "";
    var AZURE_SERVICE_NAME = "";
    var AZURE_INDEX_NAME = "";
    var AZURE_QUERY_KEY = "";
    var BAIDU_API_ID = "";
    var SEARCH_SERVICE = "hexo" || "hexo";
    var ROOT = "/"||"/";
    if(!ROOT.endsWith('/'))ROOT += '/';
  </script>

<script src="//instant.page/1.2.2" type="module" integrity="sha384-2xV8M5griQmzyiY3CDqh1dn4z3llDVqZDqzjzcY+jCBCk/a5fXJmuZ/40JJAPeoU"></script>


  <script async src="https://cdn.jsdelivr.net/npm/scrollreveal@4.0.5/dist/scrollreveal.min.js"></script>
  <script type="text/javascript">
    $(function() {
      const $reveal = $('.reveal');
      if ($reveal.length === 0) return;
      const sr = ScrollReveal({ distance: 0 });
      sr.reveal('.reveal');
    });
  </script>


  <script src="https://cdn.jsdelivr.net/npm/node-waves@0.7.6/dist/waves.min.js"></script>
  <script type="text/javascript">
    $(function() {
      Waves.attach('.flat-btn', ['waves-button']);
      Waves.attach('.float-btn', ['waves-button', 'waves-float']);
      Waves.attach('.float-btn-light', ['waves-button', 'waves-float', 'waves-light']);
      Waves.attach('.flat-box', ['waves-block']);
      Waves.attach('.float-box', ['waves-block', 'waves-float']);
      Waves.attach('.waves-image');
      Waves.init();
    });
  </script>


  <script async src="https://cdn.jsdelivr.net/gh/xaoxuu/cdn-busuanzi@2.3/js/busuanzi.pure.mini.js"></script>




  
  
  
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-backstretch/2.0.4/jquery.backstretch.min.js"></script>
    <script type="text/javascript">
      $(function(){
        if ('.cover') {
          $('.cover').backstretch(
          ["https://img.vim-cn.com/6d/a0c9e6f9efad8b731cb7376504bd10d79d2053.jpg"],
          {
            duration: "6000",
            fade: "2500"
          });
        } else {
          $.backstretch(
          ["https://img.vim-cn.com/6d/a0c9e6f9efad8b731cb7376504bd10d79d2053.jpg"],
          {
            duration: "6000",
            fade: "2500"
          });
        }
      });
    </script>
  









  <script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
  
    
      <script src="https://cdn.jsdelivr.net/gh/xaoxuu/volantis@1.0.5/js/volantis.min.js"></script>
    
  
  <script>
  var GUEST_INFO = ['nick','mail','link'];
  var guest_info = 'nick,mail,link'.split(',').filter(function(item){
    return GUEST_INFO.indexOf(item) > -1
  });
  var notify = 'true' == true;
  var verify = 'true' == true;
  var valine = new Valine();
  valine.init({
    el: '#valine_container',
    notify: notify,
    verify: verify,
    guest_info: guest_info,
    
    appId: "7IdIOOO1yeUBynVuPK9SVVWv-gzGzoHsz",
    appKey: "zw0MO9kI8f2IFbGJfw3wG5qx",
    placeholder: "欢迎来评论哟~",
    pageSize:'10',
    avatar:'mp',
    lang:'zh-cn',
    highlight:'true'
  })
  </script>



  <script src="https://cdn.jsdelivr.net/gh/xaoxuu/cdn-material-x@19.5/js/app.js"></script>


  <script src="https://cdn.jsdelivr.net/gh/xaoxuu/cdn-material-x@19.5/js/search.js"></script>




<!-- 复制 -->
<script src="https://cdn.jsdelivr.net/npm/clipboard@2/dist/clipboard.min.js"></script>
<script>
  let COPY_SUCCESS = "复制成功";
  let COPY_FAILURE = "复制失败";
  /*页面载入完成后，创建复制按钮*/
  !function (e, t, a) {
    /* code */
    var initCopyCode = function(){
      var copyHtml = '';
      copyHtml += '<button class="btn-copy" data-clipboard-snippet="">';
      copyHtml += '  <i class="fa fa-copy"></i><span>复制</span>';
      copyHtml += '</button>';
      $(".highlight .code pre").before(copyHtml);
      var clipboard = new ClipboardJS('.btn-copy', {
        target: function(trigger) {
          return trigger.nextElementSibling;
        }
      });

      clipboard.on('success', function(e) {
        //您可以加入成功提示
        console.info('Action:', e.action);
        console.info('Text:', e.text);
        console.info('Trigger:', e.trigger);
        success_prompt(COPY_SUCCESS);
        e.clearSelection();
      });
      clipboard.on('error', function(e) {
        //您可以加入失败提示
        console.error('Action:', e.action);
        console.error('Trigger:', e.trigger);
        fail_prompt(COPY_FAILURE);
      });
    }
    initCopyCode();

  }(window, document);

  /**
   * 弹出式提示框，默认1.5秒自动消失
   * @param message 提示信息
   * @param style 提示样式，有alert-success、alert-danger、alert-warning、alert-info
   * @param time 消失时间
   */
  var prompt = function (message, style, time)
  {
      style = (style === undefined) ? 'alert-success' : style;
      time = (time === undefined) ? 1500 : time*1000;
      $('<div>')
          .appendTo('body')
          .addClass('alert ' + style)
          .html(message)
          .show()
          .delay(time)
          .fadeOut();
  };

  // 成功提示
  var success_prompt = function(message, time)
  {
      prompt(message, 'alert-success', time);
  };

  // 失败提示
  var fail_prompt = function(message, time)
  {
      prompt(message, 'alert-danger', time);
  };

  // 提醒
  var warning_prompt = function(message, time)
  {
      prompt(message, 'alert-warning', time);
  };

  // 信息提示
  var info_prompt = function(message, time)
  {
      prompt(message, 'alert-info', time);
  };

</script>


<!-- fancybox -->
<script src="https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.js"></script>
<script>
  let LAZY_LOAD_IMAGE = "";
  $(".article-entry").find("fancybox").find("img").each(function () {
      var element = document.createElement("a");
      $(element).attr("data-fancybox", "gallery");
      $(element).attr("href", $(this).attr("src"));
      /* 图片采用懒加载处理时,
       * 一般图片标签内会有个属性名来存放图片的真实地址，比如 data-original,
       * 那么此处将原本的属性名src替换为对应属性名data-original,
       * 修改如下
       */
       if (LAZY_LOAD_IMAGE) {
         $(element).attr("href", $(this).attr("data-original"));
       }
      $(this).wrap(element);
  });
</script>





  <script>setLoadingBarProgress(100);</script>
</body>
</html>
